package com.zzc.action;

import com.zzc.bean.Employee;
import com.zzc.bean.ResultInfo;
import com.zzc.bean.SystemSet;
import com.zzc.service.BaseService;
import com.zzc.service.SystemSetService;
import org.apache.struts2.ServletActionContext;
import org.springframework.stereotype.Controller;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;

@Controller
public class SystemSetAction extends BaseAction{

	public SystemSetAction() {
		super();
	}
	private SystemSetService systemSetService;
	public SystemSetService getSystemSetService() {
		return systemSetService;
	}
	public void setSystemSetService(SystemSetService systemSetService) {
		this.systemSetService = systemSetService;
	}
	private String resultInfo_string="";
	private ResultInfo resultInfo;
	public void systemSetJsp() throws ServletException, IOException {
		HttpServletRequest request = ServletActionContext.getRequest();
		SystemSet systemSet = systemSetService.getSystemSet();
		request.setAttribute("systemSet", systemSet);
		request.getRequestDispatcher("/view/systemSet/systemSet.jsp").forward(request, getResponse());
	}
	public void setAdvance() throws ServletException, IOException {
		resultInfo=new ResultInfo();
		boolean result_boolean=systemSetService.setAdvance();
		if (result_boolean){
			resultInfo.setCode(200);
		}
		BaseService.printAll_json(resultInfo);
	}
}
